import store from "@/store";
import dayjs from 'dayjs';
console.log(store.state.custom_dict,99);
export const formItemStyle = {
  paddingLeft: "20px",
};

export const cellStyle = {
  background: "rgba(28, 155, 252, 0.02)",
  color: "rgb(142, 155, 185)",
  textAlign: "center",
};

// 表头单元格样式
export const headerCellStyle = {
  background: "rgba(28, 155, 252, 0.02)",
  color: "rgb(142, 155, 185)",
  textAlign: "center",
};

// 表格内表单子样式
export const tableFormStyle = {
  marginBottom: 0,
};
export const formBase = [
  {
    label: '清关单号',
    type: 'textarea',
    field: 'transitOrderNo',
    otherOptions: {
      disabled: false,
      style: {
        fontSize: '25px'
      }
    }
  },
  {
    label: '装袋日期',
    type: 'daterange',
    field: 'shelfTime',
    prop: 'shelfTime',
    required: true,
    otherOptions: {
      disabled: false,
      rangeSeparator: '至',
      startPlaceholder: '开始日期',
      endPlaceholder: '结束日期',
      valueFormat: 'yyyy-MM-dd HH:mm:ss',
      pickerOptions: {
        shortcuts: [ {
          text: "今天",
          onClick(picker) {
            const end = dayjs().format("YYYY-MM-DD 23:59:59");
            const start = dayjs().format("YYYY-MM-DD 00:00:00");
            picker.$emit("pick", [start, end]);
          },
        },
          {
            text: "昨天",
            onClick(picker) {
              const end = dayjs().subtract(1, 'day').format('YYYY-MM-DD 00:00:00');
              const start = dayjs().subtract(1, 'day').format('YYYY-MM-DD 23:59:59')
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近三天",
            onClick(picker) {
              const end = dayjs().subtract(3, 'day').format('YYYY-MM-DD 00:00:00');
              const start = dayjs().format('YYYY-MM-DD 23:59:59')
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近一周",
            onClick(picker) {
              const end = dayjs().subtract(7, 'day').format('YYYY-MM-DD 00:00:00');
              const start = dayjs().format('YYYY-MM-DD 23:59:5');
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近一个月",
            onClick(picker) {
              const end = dayjs().subtract(30, 'day').format('YYYY-MM-DD 00:00:00')
              const start = dayjs().format('YYYY-MM-DD 23:59:59')
              picker.$emit("pick", [start, end]);
            },
          },]
      }
    }
  },
  {
    label: '仓库',
    type: 'select',
    field: 'warehouseId',
    prop: 'warehouseId',
    optionsKey: 'warehouseName',
    optionsValue: 'id',
    options: store.state.custom_dict.warehouse,
  },
  {
    label: '货物类型',
    type: 'select',
    field: 'cargoTypeId',
    optionsKey: 'cargoName',
    optionsValue: 'id',
    options: store.state.custom_dict.category,
  },
  {
    label: '时效',
    type: 'select',
    field: 'ageingId',
    optionsKey: 'name',
    optionsValue: 'id',
    options: store.state.custom_dict.timely,
  },
  {
    label: '清关公司',
    type: 'select',
    field: 'customsClearanceCompanyId',
    optionsKey: 'customsName',
    optionsValue: 'id',
    options: store.state.custom_dict.customCompany,
  },
];
export const tableBase = [
  {
    label: "转运单号",
    prop: "transitOrderNo",
  },
  {
    label: "货物类型",
    prop: "cargoType",
  },
  {
    label: "装袋时间",
    prop: "baggingTime",
  },
  {
    label: "装袋人",
    prop: "recheckName",
  },
  {
    label: "仓库",
    prop: "warehouseName",
  },
  {
    label: "清关公司",
    prop: "carrierCompany",
  },
  {
    label: "派件公司",
    prop: "deliveryCompany",
  },
];

